\(\int (d+i c d x)^2 (a+b \arctan (c x)) \, dx\) [13]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 83 \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=-\frac {2}{3} i b d^2 x-\frac {b d^2 (1+i c x)^2}{6 c}-\frac {i d^2 (1+i c x)^3 (a+b \arctan (c x))}{3 c}-\frac {4 b d^2 \log (1-i c x)}{3 c} \]

[Out]

-2/3*I*b*d^2*x-1/6*b*d^2*(1+I*c*x)^2/c-1/3*I*d^2*(1+I*c*x)^3*(a+b*arctan(c*x))/c-4/3*b*d^2*ln(1-I*c*x)/c

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4972, 641, 45} \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=-\frac {i d^2 (1+i c x)^3 (a+b \arctan (c x))}{3 c}-\frac {b d^2 (1+i c x)^2}{6 c}-\frac {4 b d^2 \log (1-i c x)}{3 c}-\frac {2}{3} i b d^2 x \]

[In]

Int[(d + I*c*d*x)^2*(a + b*ArcTan[c*x]),x]

[Out]

((-2*I)/3)*b*d^2*x - (b*d^2*(1 + I*c*x)^2)/(6*c) - ((I/3)*d^2*(1 + I*c*x)^3*(a + b*ArcTan[c*x]))/c - (4*b*d^2*
Log[1 - I*c*x])/(3*c)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 641

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c/e)*x)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 4972

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a + b*
ArcTan[c*x])/(e*(q + 1))), x] - Dist[b*(c/(e*(q + 1))), Int[(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x] /; FreeQ[{
a, b, c, d, e, q}, x] && NeQ[q, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {i d^2 (1+i c x)^3 (a+b \arctan (c x))}{3 c}+\frac {(i b) \int \frac {(d+i c d x)^3}{1+c^2 x^2} \, dx}{3 d} \\ & = -\frac {i d^2 (1+i c x)^3 (a+b \arctan (c x))}{3 c}+\frac {(i b) \int \frac {(d+i c d x)^2}{\frac {1}{d}-\frac {i c x}{d}} \, dx}{3 d} \\ & = -\frac {i d^2 (1+i c x)^3 (a+b \arctan (c x))}{3 c}+\frac {(i b) \int \left (-2 d^3+\frac {4 d^2}{\frac {1}{d}-\frac {i c x}{d}}-d^2 (d+i c d x)\right ) \, dx}{3 d} \\ & = -\frac {2}{3} i b d^2 x-\frac {b d^2 (1+i c x)^2}{6 c}-\frac {i d^2 (1+i c x)^3 (a+b \arctan (c x))}{3 c}-\frac {4 b d^2 \log (1-i c x)}{3 c} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.69 \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=\frac {1}{3} d^2 \left (\frac {1}{2} b x (-6 i+c x)-\frac {(-i+c x)^3 (a+b \arctan (c x))}{c}-\frac {4 b \log (i+c x)}{c}\right ) \]

[In]

Integrate[(d + I*c*d*x)^2*(a + b*ArcTan[c*x]),x]

[Out]

(d^2*((b*x*(-6*I + c*x))/2 - ((-I + c*x)^3*(a + b*ArcTan[c*x]))/c - (4*b*Log[I + c*x])/c))/3

Maple [A] (verified)

Time = 0.78 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.24

method result size
derivativedivides \(\frac {-\frac {i a \,d^{2} \left (i c x +1\right )^{3}}{3}+b \,d^{2} \left (-\frac {c^{3} x^{3} \arctan \left (c x \right )}{3}+i \arctan \left (c x \right ) c^{2} x^{2}+c x \arctan \left (c x \right )-\frac {i \arctan \left (c x \right )}{3}+\frac {i \left (-3 c x -\frac {i c^{2} x^{2}}{2}+2 i \ln \left (c^{2} x^{2}+1\right )+4 \arctan \left (c x \right )\right )}{3}\right )}{c}\) \(103\)
default \(\frac {-\frac {i a \,d^{2} \left (i c x +1\right )^{3}}{3}+b \,d^{2} \left (-\frac {c^{3} x^{3} \arctan \left (c x \right )}{3}+i \arctan \left (c x \right ) c^{2} x^{2}+c x \arctan \left (c x \right )-\frac {i \arctan \left (c x \right )}{3}+\frac {i \left (-3 c x -\frac {i c^{2} x^{2}}{2}+2 i \ln \left (c^{2} x^{2}+1\right )+4 \arctan \left (c x \right )\right )}{3}\right )}{c}\) \(103\)
parts \(-\frac {i a \,d^{2} \left (i c x +1\right )^{3}}{3 c}-\frac {b \,d^{2} c^{2} x^{3} \arctan \left (c x \right )}{3}+i b \,d^{2} c \arctan \left (c x \right ) x^{2}+b \arctan \left (c x \right ) x \,d^{2}+\frac {i d^{2} b \arctan \left (c x \right )}{c}-i b \,d^{2} x +\frac {x^{2} d^{2} c b}{6}-\frac {2 b \,d^{2} \ln \left (c^{2} x^{2}+1\right )}{3 c}\) \(113\)
parallelrisch \(\frac {-2 x^{3} \arctan \left (c x \right ) b \,d^{2} c^{3}+6 i b \,d^{2} \arctan \left (c x \right ) x^{2} c^{2}-2 a \,c^{3} d^{2} x^{3}+6 i x^{2} a \,c^{2} d^{2}+b \,c^{2} d^{2} x^{2}-6 i b \,d^{2} x c +6 b \arctan \left (c x \right ) d^{2} c x +6 i b \,d^{2} \arctan \left (c x \right )+6 a c \,d^{2} x -4 b \ln \left (c^{2} x^{2}+1\right ) d^{2}}{6 c}\) \(132\)
risch \(\frac {i d^{2} \left (c x -i\right )^{3} b \ln \left (i c x +1\right )}{6 c}-\frac {i d^{2} c^{2} b \,x^{3} \ln \left (-i c x +1\right )}{6}-\frac {x^{3} d^{2} c^{2} a}{3}+i a c \,d^{2} x^{2}-\frac {d^{2} c \,x^{2} b \ln \left (-i c x +1\right )}{2}+\frac {i b \,d^{2} x \ln \left (-i c x +1\right )}{2}+\frac {x^{2} d^{2} c b}{6}-i b \,d^{2} x +x \,d^{2} a +\frac {7 i d^{2} b \arctan \left (c x \right )}{6 c}-\frac {7 b \,d^{2} \ln \left (c^{2} x^{2}+1\right )}{12 c}\) \(163\)

[In]

int((d+I*c*d*x)^2*(a+b*arctan(c*x)),x,method=_RETURNVERBOSE)

[Out]

1/c*(-1/3*I*a*d^2*(1+I*c*x)^3+b*d^2*(-1/3*c^3*x^3*arctan(c*x)+I*arctan(c*x)*c^2*x^2+c*x*arctan(c*x)-1/3*I*arct
an(c*x)+1/3*I*(-3*c*x-1/2*I*c^2*x^2+2*I*ln(c^2*x^2+1)+4*arctan(c*x))))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.53 \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=-\frac {2 \, a c^{3} d^{2} x^{3} - {\left (6 i \, a + b\right )} c^{2} d^{2} x^{2} - 6 \, {\left (a - i \, b\right )} c d^{2} x + 7 \, b d^{2} \log \left (\frac {c x + i}{c}\right ) + b d^{2} \log \left (\frac {c x - i}{c}\right ) - {\left (-i \, b c^{3} d^{2} x^{3} - 3 \, b c^{2} d^{2} x^{2} + 3 i \, b c d^{2} x\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{6 \, c} \]

[In]

integrate((d+I*c*d*x)^2*(a+b*arctan(c*x)),x, algorithm="fricas")

[Out]

-1/6*(2*a*c^3*d^2*x^3 - (6*I*a + b)*c^2*d^2*x^2 - 6*(a - I*b)*c*d^2*x + 7*b*d^2*log((c*x + I)/c) + b*d^2*log((
c*x - I)/c) - (-I*b*c^3*d^2*x^3 - 3*b*c^2*d^2*x^2 + 3*I*b*c*d^2*x)*log(-(c*x + I)/(c*x - I)))/c

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 206 vs. \(2 (73) = 146\).

Time = 1.51 (sec) , antiderivative size = 206, normalized size of antiderivative = 2.48 \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=- \frac {a c^{2} d^{2} x^{3}}{3} - \frac {b d^{2} \left (\frac {\log {\left (13 b c d^{2} x - 13 i b d^{2} \right )}}{6} + \frac {17 \log {\left (13 b c d^{2} x + 13 i b d^{2} \right )}}{24}\right )}{c} - x^{2} \left (- i a c d^{2} - \frac {b c d^{2}}{6}\right ) - x \left (- a d^{2} + i b d^{2}\right ) + \left (\frac {i b c^{2} d^{2} x^{3}}{6} + \frac {b c d^{2} x^{2}}{2} - \frac {i b d^{2} x}{2}\right ) \log {\left (i c x + 1 \right )} + \frac {\left (- 4 i b c^{3} d^{2} x^{3} - 12 b c^{2} d^{2} x^{2} + 12 i b c d^{2} x - 11 b d^{2}\right ) \log {\left (- i c x + 1 \right )}}{24 c} \]

[In]

integrate((d+I*c*d*x)**2*(a+b*atan(c*x)),x)

[Out]

-a*c**2*d**2*x**3/3 - b*d**2*(log(13*b*c*d**2*x - 13*I*b*d**2)/6 + 17*log(13*b*c*d**2*x + 13*I*b*d**2)/24)/c -
 x**2*(-I*a*c*d**2 - b*c*d**2/6) - x*(-a*d**2 + I*b*d**2) + (I*b*c**2*d**2*x**3/6 + b*c*d**2*x**2/2 - I*b*d**2
*x/2)*log(I*c*x + 1) + (-4*I*b*c**3*d**2*x**3 - 12*b*c**2*d**2*x**2 + 12*I*b*c*d**2*x - 11*b*d**2)*log(-I*c*x
+ 1)/(24*c)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 138 vs. \(2 (65) = 130\).

Time = 0.29 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.66 \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=-\frac {1}{3} \, a c^{2} d^{2} x^{3} - \frac {1}{6} \, {\left (2 \, x^{3} \arctan \left (c x\right ) - c {\left (\frac {x^{2}}{c^{2}} - \frac {\log \left (c^{2} x^{2} + 1\right )}{c^{4}}\right )}\right )} b c^{2} d^{2} + i \, a c d^{2} x^{2} + i \, {\left (x^{2} \arctan \left (c x\right ) - c {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )}\right )} b c d^{2} + a d^{2} x + \frac {{\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} b d^{2}}{2 \, c} \]

[In]

integrate((d+I*c*d*x)^2*(a+b*arctan(c*x)),x, algorithm="maxima")

[Out]

-1/3*a*c^2*d^2*x^3 - 1/6*(2*x^3*arctan(c*x) - c*(x^2/c^2 - log(c^2*x^2 + 1)/c^4))*b*c^2*d^2 + I*a*c*d^2*x^2 +
I*(x^2*arctan(c*x) - c*(x/c^2 - arctan(c*x)/c^3))*b*c*d^2 + a*d^2*x + 1/2*(2*c*x*arctan(c*x) - log(c^2*x^2 + 1
))*b*d^2/c

Giac [F]

\[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=\int { {\left (i \, c d x + d\right )}^{2} {\left (b \arctan \left (c x\right ) + a\right )} \,d x } \]

[In]

integrate((d+I*c*d*x)^2*(a+b*arctan(c*x)),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.45 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.31 \[ \int (d+i c d x)^2 (a+b \arctan (c x)) \, dx=\frac {d^2\,\left (6\,a\,x+6\,b\,x\,\mathrm {atan}\left (c\,x\right )-b\,x\,6{}\mathrm {i}\right )}{6}-\frac {c^2\,d^2\,\left (2\,a\,x^3+2\,b\,x^3\,\mathrm {atan}\left (c\,x\right )\right )}{6}+\frac {d^2\,\left (-4\,b\,\ln \left (c^2\,x^2+1\right )+b\,\mathrm {atan}\left (c\,x\right )\,6{}\mathrm {i}\right )}{6\,c}+\frac {c\,d^2\,\left (a\,x^2\,6{}\mathrm {i}+b\,x^2+b\,x^2\,\mathrm {atan}\left (c\,x\right )\,6{}\mathrm {i}\right )}{6} \]

[In]

int((a + b*atan(c*x))*(d + c*d*x*1i)^2,x)

[Out]

(d^2*(6*a*x - b*x*6i + 6*b*x*atan(c*x)))/6 - (c^2*d^2*(2*a*x^3 + 2*b*x^3*atan(c*x)))/6 + (d^2*(b*atan(c*x)*6i
- 4*b*log(c^2*x^2 + 1)))/(6*c) + (c*d^2*(a*x^2*6i + b*x^2 + b*x^2*atan(c*x)*6i))/6